from base.api.weather_forecast import WeatherForecast
from config import BaseDir
from page.weather_forcast_page import weather_forecast_page
from uitls.bulid_data import bulid_data


class WeatherForecast1:
    def __init__(self):
        self.weather_page = weather_forecast_page()
        self.fileName = BaseDir + "/data/data_weather.xml"
        self.bulid_data = bulid_data()


    def weather_test(self):
        data = self.bulid_data.read_xml(self.fileName, "test_data", "test_SZ")
        print(data)
        result = self.weather_page.weather_forecaast_page(data)
        print(result.json())

if __name__ == '__main__':
    WeatherForecast1().weather_test()
